package com.cyh.testdesignpattern.factory.absfactory.order;

import com.cyh.testdesignpattern.factory.absfactory.pizza.Pizza;

public class OrderPizza {
    AbsFactory absFactory;
    public OrderPizza(AbsFactory absFactory, String orderTye) {
        setAbsFactory(absFactory, orderTye);
    }
    private void setAbsFactory(AbsFactory absFactory, String orderType) {
        this.absFactory = absFactory;
        Pizza pizza = absFactory.createPizza(orderType);
        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();
    }
}
